package com.wildfire.dao;


import com.wildfire.dto.UserDto;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface UserDao {
    @Select("SELECT * from t_user")
    List<UserDto> getUserPage();

    @Select("SELECT * from t_user where token=#{token}")
    UserDto getUserInfo(String token);

    @Select("SELECT token from t_user where name=#{name} and pass=#{pass}")
    String getUserToken(@Param("name") String name,@Param("pass") String pass);

    @Select("select name from t_role where id in (SELECT role_id from t_user_role where user_id=#{id})")
    List<String> getUserAccess(long id);

    @Select("SELECT * from t_user where name=#{name}")
    UserDto getUserInfoByName(String name);

}
